﻿
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
<div style="margin-bottom: 50px;">
    <input type="button" id="getAccess_token" value="获取access_token" />
</div>
<p>
    <textarea id="res" style="width: 900px; height: 300px;"></textarea>
</p>

<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script>
    $(function() {
        var indexMethod = {
            getToken: function () {
                $('#getAccess_token').click(function() {
                      $.ajax({
                    url: '@Url.Action("GetToken")',
                    type:'get',
                    success:function(res) {
                        $('#res').html(res);
                    }
                  });
                });
            },
            init:function() {
                indexMethod.getToken();
            }
        }

        indexMethod.init();
    });
</script>